﻿<!doctype html>
<html>
<!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>客服咨询</title>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script> 
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script> 
	<script charset="utf-8" src="../js/find.js"></script>
	<link rel="stylesheet" href="../css/default.css" />
<script type="text/javascript" src="../js/manhuaDate.1.0.js"></script> 
<script type="text/javascript" src="../js/userSelecterNew.js"></script> 
<script type="text/javascript" src="../js/pagination.js"></script> 
<script type="text/javascript" src="../js/customerSelecterNew.js"></script> 
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
	$(".hideDiv").each(function(){
		addMargin($(this));
	})
	restForm();
	$("input[type='file']").change(function(){
		$(this).prev().prev().val($(this).val())
	})
	$("#dtBegin").val(getToday());
	$("#dtEnd").val(getToday());
});

var pageCount=0;
var pageIndex=1;
$(function(){
	$(".hideDiv").each(function(){
		addMargin($(this));
	})
	
});


function getFucnMenuDetailList(page){
	if(IsEmpty(page)){
		pageIndex=1
	}else{
		pageIndex = page
	}
	var dtBegin = $("#dtBegin").val()
	var dtEnd = $("#dtEnd").val()
	var custName = $("#custName").val()
	var userName  = $("#userName").val()
	var param={'userName':userName,'dtEnd':dtEnd,'dtBegin':dtBegin,'custName':custName}

	
	 adList = _findInfo("../adviceMessage/find/adviceMessage/"+(pageIndex -1)+"/10", param);
	if(adList.state==0){
		 $("#funcMenuList tbody").empty();
		 for(var i = 0;i<adList.result.data.length;i++){
			 var htm="<tr>"
			 		htm+="<td>"+_getStringOfJson(i, adList, "staName")+"</td>";
			 		htm+="<td>"+_getStringOfJson(i, adList, "createdTime")+"</td>";
			 		htm+="<td>"+_getStringOfJson(i, adList, "customerName")+"</td>";
			 		htm+="<td>"+_getStringOfJson(i, adList, "mp")+"</td>";
			 		htm+="<td>"+_getStringOfJson(i, adList, "content")+"</td>";
			 		htm+="<td>"+_getStringOfJson(i, adList, "userName")+"</td>";			 		
			 		htm+="<td><input class=\"common_btn to_update\" type=\"button\" onclick=\"toReply("+_getStringOfJson(i, adList, "memberId")+")\" value=\"回复\"></td>";			 		
			 		htm+="</tr>"
			 		$("#funcMenuList tbody").append(htm);
		 }
		 _loadPage("pager", pageIndex, 10, adList, getFucnMenuDetailList, "NoResult")
		$("#sup").html("共"+adList.result.len+"条");	
		
		 
	}
	
}

function toReply(id){
	$("#memberId").val(id)
	$('#yinying1,#replyShowDiv').show()

}
function reply(){
	var memberId = $("#memberId").val()
	var content = $("#replyShow").val()
	var heads = new Array("memberId","content")
	var datas = new Array(memberId,content);
	var json = _getJsonParseInsertStr(heads, datas);
	var dt = _PostInfoRstNoMessage("../adviceMessage/insert/insertInfo2", {'data':json});
	if(IsNotEmpty(dt)&&dt.state==0){
		$('#yinying1,#replyShowDiv').hide()
		$("#replyShow").val("")
		getFucnMenuDetailList(1);
		art.dialog({fixed:true, lock: true,content:"回复成功",icon:'succeed',ok:true});	
	}else{
		art.dialog({fixed:true, lock: true,content:"回复失败",icon:'error',ok:true});	
	}
}

</script>


</head>

<body>
<!-- InstanceBeginEditable name="EditRegion3" --> 
<div id="yinying1"></div>
<div id="replyShowDiv" class="hideDiv">
			<div class="closeTop">
			<input id="memberId" type="hidden">
				<span id="closeThe"><img onclick="$('#yinying1,#replyShowDiv').hide()" src="../images/close.png"></span>
			</div>
			<div>
				<p>
					<label>回复客户：</label>
					<br />
					<textarea id="replyShow" style="width: 90%; height: 150px;"></textarea>
				</p>
				<p class="BottomBtn">
					<input type = "button" value="确定" onclick="reply()">
				</p>
			</div>
		</div>

<script type="text/javascript">
$(function(){
	refreshInput($(".serWrapper"));
		$(this).prev().prev().val($(this).val())
	})

</script>    
<div class="container" id="container">
  <div class="container_R fr">
    <div class="place">客服咨询</div>
    <div class="member_search">
      <p>
       <span>起始日期：</span>
		<input id="dtBegin" class="doubledate" type="text" value="" >
		 <span>截止日期：</span>
		<input id="dtEnd" class="doubledate" type="text" value="">
		 <span>会员姓名：</span>
					<input id="custName" class="absoluteTxt" type="text" value="">
		
		<p>
		     <span>工作人员姓名：</span>
					<input id="userName" class="absoluteTxt" type="text" value="">

        		<input class="btn" id="research" name="查询" type="button" value="查询" onClick="getFucnMenuDetailList(1)" ></p>
        </div>
       <table width="100%" class="member_list" cellpadding="0" cellspacing="1" border="0" id="funcMenuList">
    	<caption><strong>咨询列表       <span id="sup">共0条</span></caption>
    	<thead>
    	<tr>
    		<th >交流类型</th>
        	<th >交流时间</th>
        	<th >客户姓名</th>
    		<th >客户电话</th>
    		<th >交流内容</th>
        	<th >工作人员姓名</th>
        	<th >操作</th>
        </tr>
        </thead>
       	<tbody>
       		
       	</tbody>
    </table>
      <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager"></div>
  </div>
  <div class="fc"></div>
</div>
<!-- InstanceEndEditable --> 
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
clearThis("absoluteTxt");
showTab(5,3);
</script>
</body>
<!-- InstanceEnd -->
</html>
